package ZiFuChuan;

/**
 * 时间： 2021/9/29 -  8:50
 */
public class Greeting {
    public static void main(String[] args) {
        String greeting = "Hello";
        int n = greeting.length();
        int cpCount = greeting.codePointCount(0, greeting.length());
        int index = greeting.offsetByCodePoints(0,3);
        int cp = greeting.codePointAt(index);
        System.out.println(cpCount);
        System.out.println(n);
        System.out.println(index);
        System.out.println(cp);

    }
}
class MaDian{
    public static void main(String[] args){
        String a = "Hello";
        int i = 0;
        char ch = a.charAt(i);
    if(Character.isSupplementaryCodePoint(ch)){
        i += 2;
    }
    else i++;
        System.out.println(ch);
    }

}
class GouJian {
    public static void main(String[] args){
        StringBuilder a = new StringBuilder( "how greatly ");
        a.append("it is");
        String b = a.toString();
        StringBuilder c = new StringBuilder(b);
        c.append("2.0");
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);

    }
}
